package me.lwn.auth.utils;

import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;

public class DateUtils {

    public static Instant localDateToInstant(LocalDate localDate) {
        ZoneId zoneId = ZoneId.systemDefault();
        return localDate.atStartOfDay().atZone(zoneId).toInstant();
    }

    public static LocalDate instantToLocalDate(Instant instant) {
        ZoneId zoneId = ZoneId.systemDefault();
        return instant.atZone(zoneId).toLocalDate();
    }
}
